;(function(global){
		global.zwCalender = {
			getMonthDays: getMonthDays,
			getOffset: getOffset,
			getMonthDayCount: getMonthDayCount,
			isLeapYear: isLeapYear
		};
		function getMonthDays(yearmonth){
			yearmonth += '';
			var year = yearmonth.substr(0,4);
			var month = yearmonth.substr(4);
			var lastday = getMonthDayCount(year, month);
			var offset = getOffset(year, month);
			var days = [],r = {};
			var i, l, day;
			for(i = 0; i < offset; i++){
				days.push('0');
			}
			for(i = 0; i < lastday; i++){
				day = i + 1;
				days.push('' + day);
			}
			var supliment = days.length % 7 === 0 ? 0 : 7 - days.length % 7;

			for(i = 0; i < supliment; i++){
				days.push('0');
			}
			r[yearmonth] = days;
			return r;
		}
		function getOffset(year, month){
			var offset, t;
			t = new Date();
			t.setDate(1);
			t.setMonth(month - 1);
			t.setFullYear(year);
			offset = t.getDay();
			return offset;
		}
		function isNumber(arg){
			return /^\d+$/.test(arg);
		}
		function isLeapYear(year){
			return year % 100 === 0 ? ( year % 400 === 0 ? true : false ) : year % 4 === 0 ? true : false;
		}
		function getMonthDayCount(year,month){
			var count;
			switch(month){
				case 2:
				case '2':
					count = isLeapYear(year) ? 29 : 28;
					break;
				default:
					count = month < 8 ? ( month % 2 === 0 ? 30 : 31 ) : month % 2 === 0 ? 31 : 30;
			}
			return count;
		}
	})(typeof window !== 'undefined' ? window : this);